/*******************************************************************************
 * Copyright (c) 2011 Olexandr V. Shaposhnikov.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Olexandr V. Shaposhnikov - initial API and implementation and/or initial documentation
 *******************************************************************************/
package com.funkyroach.use.res;

import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;

public final class USImages {

    public static final IPath ICONS_PATH = new Path("com/funkyroach/use/res/icons/full"); //$NON-NLS-1$
    private static final String NAME_PREFIX = "com.funkyroach.use.ui."; //$NON-NLS-1$
    private static ImageRegistry s_ImageRegistry = null;

    public static final String IMG_OBJS_CLASS = NAME_PREFIX + "class_obj.gif"; //$NON-NLS-1$
    public static final String IMG_OBJS_STRUCT = NAME_PREFIX + "struct_obj.gif"; //$NON-NLS-1$
    public static final String IMG_OBJS_ENUM = NAME_PREFIX + "enum_obj.gif"; //$NON-NLS-1$

    public static final String IMG_OBJS_FIELD = NAME_PREFIX + "field_default_obj.gif"; //$NON-NLS-1$
    public static final String IMG_FIELD_DEFAULT = NAME_PREFIX + "field_default_obj.gif"; //$NON-NLS-1$
    public static final String IMG_FIELD_PRIVATE = NAME_PREFIX + "field_private_obj.gif"; //$NON-NLS-1$
    public static final String IMG_FIELD_PROTECTED = NAME_PREFIX + "field_protected_obj.gif"; //$NON-NLS-1$
    public static final String IMG_FIELD_PUBLIC = NAME_PREFIX + "field_public_obj.gif"; //$NON-NLS-1$

    public static final String IMG_METHOD_PUBLIC = NAME_PREFIX + "methpub_obj.gif"; //$NON-NLS-1$
    public static final String IMG_METHOD_PROTECTED = NAME_PREFIX + "methpro_obj.gif"; //$NON-NLS-1$
    public static final String IMG_METHOD_PRIVATE = NAME_PREFIX + "methpri_obj.gif"; //$NON-NLS-1$
    public static final String IMG_METHOD_DEFAULT = NAME_PREFIX + "methdef_obj.gif"; //$NON-NLS-1$

    public static ImageRegistry getImageRegistry() {
        if (s_ImageRegistry == null) {
            s_ImageRegistry = new ImageRegistry();
        }
        return s_ImageRegistry;
    }

    public static ImageDescriptor getDescriptor(String key) {
        return getImageRegistry().getDescriptor(key);
    }

    public static Image get(String key) {
        return getImageRegistry().get(key);
    }

}
